<template>
  <view class="announcement-container">
    <!-- 公告项 -->
    <view 
      class="announcement-card"
      :class="card.type"
      v-for="(card, index) in announcements"
      :key="index"
    >
      <view class="announcement-title">
        <!-- <uni-icons :type="card.icon" size="18" color="#2c3e50"></uni-icons> -->
        {{ card.title }}
      </view>
      <view class="announcement-summary">
        {{ card.summary }}
      </view>
      <view class="announcement-meta">
        <text>{{ card.author }}</text>
        <text>{{ card.date }}</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  data() {
    return {
      announcements: [
        {
          type: 'important',
          icon: 'info',
          title: '系统维护通知',
          summary: '将于2023年8月15日凌晨2点至5点进行系统维护...',
          author: '管理员',
          date: '2023-08-10'
        },
        {
          type: 'info',
          icon: 'help',
          title: '新功能上线公告',
          summary: '新增个人中心自定义功能，欢迎体验并提出宝贵意见...',
          author: '产品团队',
          date: '2023-08-08'
        }
        // 更多公告...
      ]
    };
  }
};
</script>

<style scoped>
.announcement-container {
  padding: 20rpx;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20rpx;
}

.announcement-card {
  background-color: #FFFFFF; /* 推荐背景色 */
  border-radius: 16rpx;
  padding: 30rpx;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.05);
  border: 1rpx solid #eee;
}

.announcement-card.important {
  border-left: 8rpx solid #e74c3c;
}

.announcement-card.warning {
  border-left: 8rpx solid #f39c12;
}

.announcement-card.info {
  border-left: 8rpx solid #3498db;
}

.announcement-card.success {
  border-left: 8rpx solid #2ecc71;
}

.announcement-title {
  font-size: 34rpx;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 20rpx;
  display: flex;
  align-items: center;
}

.announcement-summary {
  font-size: 30rpx;
  color: #555;
  line-height: 1.6;
  margin-bottom: 25rpx;
}

.announcement-meta {
  display: flex;
  justify-content: space-between;
  font-size: 26rpx;
  color: #95a5a6;
  border-top: 1rpx solid #f0f2f5;
  padding-top: 20rpx;
}
</style>